package com.my.config;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * @Author hujf
 * @Date 2021/10/25 16:55
 * @Description Api 配置类
 */
public class ApiConfig {

    private final Map map = new HashMap();

    public Map getConfig() {
        String path = this.getClass().getResource("/").getPath() + "/rarn.conf";
        try {
            FileInputStream fileInputStream = new FileInputStream(path);
            Properties properties = new Properties();
            properties.load(fileInputStream);
            Enumeration e = properties.propertyNames();

            while (e.hasMoreElements()) {
                String key = (String) e.nextElement();
                map.put(key, properties.getProperty(key));
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        return map;
    }



}
